// 官网的“搜索”功能
function search(){
    var keyword = $("#keyword").val();
    var keyword2 = $("#keyword2").val();

    var length = keyword.length;
    var length2 = keyword2.length;

    if (length > 0 && length2 == 0){
        if (length > 20){
            alert("关键词应小于20个字~");
        } else{
            location.href = "/search/" + keyword;
        }
    }

    if (length == 0 && length2 > 0){
        if (length2 > 20){
            alert("关键词应小于20个字~");
        } else{
            location.href = "/search/" + keyword2;
        }
    }

    if (length==0 && length2==0){
        alert("请输入搜索的关键词~");
    }
}
